<?php include_once './application/views/sys_admin/common/header.php';  ?>
<div class=" definewidth m20">
	<form  method="post" id="msgonlineForm" name="msgonlineForm"  enctype="multipart/form-data">
		<input type="hidden" name="type" id="type" value="<?php echo $type;?>"/>
	<table class="table table-bordered table-hover m10">
		<tr>
	        <td class="tableleft"> 应用场景</td>
	        <td><input type="text" name="application_scene" id="application_scene" size="50" value="" /> </td>
	    </tr>
	    <tr>
	        <td class="tableleft"> 标题</td>
	        <td> <input type="text" name="title" id="title" size="50"  value="" /></td>
	    </tr>
	    <?php if($type == 2){?>
	    <tr>
	        <td class="tableleft">内容 </td>
	        <td> <textarea name="content" id="content" rows="8" cols="80" style="width: 800px; height: 160px;"></textarea></td>
	    </tr>
	    <?php }else{?>
	    <tr>
	        <td class="tableleft">内容编辑 </td>
	        <td>
	        	<script type="text/javascript" charset="utf-8" src="/static/ueditor/ueditor.config.js"></script>
    				<script type="text/javascript" charset="utf-8" src="/static/ueditor/ueditor.all.js"></script>
    				<script type="text/javascript" charset="utf-8">
			          var editor = new baidu.editor.ui.Editor();
			          editor.render('content');  //editor为编辑器容器的id
			      </script>
				<textarea name="content" id="content" style="width:800px"></textarea>
	         </td>
	    </tr>
	    <?php }?>
	    <tr>
	        <td class="tableleft"> </td>
	        <td><button type="button" class="btn btn-success"  onclick="msgonlineSubmit();" >提交</button></td>
	    </tr>
	 </table>  
	</form>
</div>

<script type="text/javascript">
function msgonlineSubmit(){
	var options = {
		url : '/sys_admin/msgonline/add/',
		dataType: "json",
		type:"post",
		success : function(ret) {
			if(ret.msg=='1'){
				alert("操作成功");
				window.location.href ='/sys_admin/msgonline/index/?type=<?php echo $type;?>';
			}else{
				alert(ret.msg);
			}
			
		}
	};
	$("#msgonlineForm").ajaxSubmit(options);
	return false;
}
</script>
<div id="dialog" title="系统提示" style="display:none"><p id="msg" style="text-align:center"></p></div>
